#ifndef __SHIP_H__
#define __SHIP_H__

#include "define.h"
#include <Ogre.h>
#include <vector>
namespace boost {
namespace serialization {

template<class Archive>
  void serialize(Archive & ar, Ogre::Vector3 & v, const unsigned int version)
{
  ar & v.x;
  ar & v.y;
  ar & v.z;
}

template<class Archive>
  void serialize(Archive & ar, Ogre::Quaternion & q, const unsigned int version)
{
  ar & q.x;
  ar & q.y;
  ar & q.z;
  ar & q.w;
}
}
}
class Ship
{
public:
    Ship();
	Ship(ship_type _type, std::string _name,Ogre::Vector3 _original_pos,Ogre::Quaternion _original_ori,bool _init_graphic);
	virtual ~Ship();

	Ogre::SceneNode*	 get_scene_node()	 {return mNode;}
	ship_type			 get_type()			 {return mType;}
	Ogre::Vector3		 get_position()		 {return mPosition;}
	Ogre::Quaternion	 get_orientation()	 {return mOrientation;}

	void init_graphic(std::string& _name);

	void shoot(int _id);
	void un_shoot(int _id);

	void update(Ogre::Vector3 _position, Ogre::Quaternion _orientation);
	void respawn();
	template<class Archive>
	  void serialize(Archive& ar, const unsigned int version)
	  {
	    ar & mType & mPosition & mOrientation;
	  }

private:
	std::vector<Thruster*>		      mThrusters;
	std::vector<Battery*>			  mBatteries;
	std::vector<Ogre::ManualObject*>  mBatteryShots;
	Ogre::Vector2					  mDimensions;
	ship_type						  mType;	
	Ogre::SceneNode*				  mNode;
	Ogre::Vector3					  mPosition;
	Ogre::Quaternion				  mOrientation;
};	

#endif 
